package com.woniu.service.sportsHealth.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

import com.woniu.mapper.sportsHealth.WeightMapper;
import com.woniu.model.sportsHealth.entity.Weight;
import com.woniu.model.sportsHealth.model.dto.WeightDto;
import com.woniu.service.sportsHealth.IWeightService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 体重表 服务实现类
 * </p>
 *
 * @author Jet
 * @since 2023-10-23
 */
@Service
public class WeightServiceImpl extends ServiceImpl<WeightMapper, Weight> implements IWeightService {

    @Autowired
    WeightMapper weightMapper;
    @Override
    public PageInfo<WeightDto> findAll(Map<String, Object> param, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<WeightDto> weightDtoList = weightMapper.findAll(param);
        PageInfo<WeightDto> weightDtoPageInfo = new PageInfo<>(weightDtoList);
        return weightDtoPageInfo;
    }
}
